import React, { Component } from 'react'
import {Switch, Route, Redirect} from 'react-router-dom'
import Index from '../components/Index'
import NotFound from '../components/NotFound'
import Redux from '../components/Redux'
import Redux2 from '../components/Redux2'
import UseStateFn from '../components/UseStateFn'
import UseStateClass from '../components/UseStateClass'
import UseEffecteFn from '../components/UseEffectFn.js'
import UseEffectClass from '../components/UseEffectClass'
import UseReducer from '../components/UseReducer'
import UseContext from '../components/UseContext'
import Login from '../components/Login'

export default class Router extends Component {
  render() {
    return (
      <>
        <Switch>
          <Route path="/index" component={Index}></Route>
          <Route path="/notfound" component={NotFound}></Route>
          <Route path="/redux" component={Redux}></Route>
          <Route path="/redux2" component={Redux2}></Route>
          <Route path="/usestatefn" component={UseStateFn}></Route>
          <Route path="/usestateclass" component={UseStateClass}></Route>
          <Route path="/useeffectfn" component={UseEffecteFn}></Route>
          <Route path="/useeffectclass" component={UseEffectClass}></Route>
          <Route path="/usereducer" component={UseReducer}></Route>
          <Route path="/usecontext" component={UseContext}></Route>
          <Route path="/login" component={Login}></Route>
          <Redirect to="/index"></Redirect>
        </Switch>
      </>
    )
  }
}
